
<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>K8S搭建踩坑之路 - 我在开了灯的床头下，想问问自己的心啊。</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate" />
  
  <meta name="keywords" content="yuanyl,"> 
  
  <meta name="description" content="The Technology blog,K8S是什么？k8s是基于容器技术的分布式架构领先方案..."> 
  
  <meta name="author" content="yuanyl"> 
  <link rel="shortcut icon" href="http://freeyjay.gitee.io/blog/image/favicon.ico">
  
<link rel="stylesheet" href="/blog/css/style.css">


  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_58xq2j9v1id.css">

  

  
  
  
<link rel="stylesheet" href="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.css">

  

  
  
  
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.15.10/styles/a11y-dark.min.css">

  

  <script>
    var CONFIG = window.CONFIG || {}
    CONFIG = {
      fancybox: true,
      pjax: false,
      donate_alipay: '',
      donate_wechat: 'http://freeyjay.gitee.io/image_bed/pic/wechat.jpg',
      gitalk: {
        enable: false,
        clientID: '',
        clientSecret: '',
        id: window.location.pathname,
        repo: '',
        owner: '',
        admin: ''
      },
      motto: {
        api: '',
        default: '橘子金黄，玻璃晴朗。'
      }
    }
  </script>

  

<meta name="generator" content="Hexo 4.2.0"></head>
<body class="lock-screen">
  <div class="loading">
  <div class="loading-wrap">
    <div class="loading-spinner">
      <div class="loading-bounce1"></div>
      <div class="loading-bounce2"></div>
    </div>
  </div>
</div>
  <header>
  <nav class="menu">
  <div class="menu-close">
    <i class="iconfont iconplus"></i>
  </div>
  <ul class="menu-content">
    
    
    
    
    <li class="menu-item"><a href="/ "> 首页</a></li>
    
    
    
    
    <li class="menu-item"><a href="/archives "> 归档</a></li>
    
    
    
    
    <li class="menu-item"><a href="/about "> 关于</a></li>
    
  </ul>
  <div class="menu-copyright"><p>Copyright© 2019-2019 | <a target="_blank" href="https://gitee.com/FreeYJay">yuanyl</a> .AllRightsReserved</p></div>
</nav>
</header>
  <main id="main">
  <div class="container" id="container">
    <article class="article">
  <section class="head">
  <img src="http://freeyjay.gitee.io/blog/image/post-image.jpg" draggable="false">
  <div class="head-mask">
    <h1 class="head-title">K8S搭建踩坑之路</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>2020-04-27</span
        class="post-info-item">
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>4333</span>
    </div>
  </div>
</section>
  <section class="main">
    <section class="content">
      <h1 id="K8S是什么？"><a href="#K8S是什么？" class="headerlink" title="K8S是什么？"></a>K8S是什么？</h1><h4 id="k8s是基于容器技术的分布式架构领先方案。它是google严格保密十几年的秘密武器Brog的一个开源版本；是Google开源的一个容器编排引擎，支持自动化部署、大规模可伸缩、应用容器化管理。"><a href="#k8s是基于容器技术的分布式架构领先方案。它是google严格保密十几年的秘密武器Brog的一个开源版本；是Google开源的一个容器编排引擎，支持自动化部署、大规模可伸缩、应用容器化管理。" class="headerlink" title="k8s是基于容器技术的分布式架构领先方案。它是google严格保密十几年的秘密武器Brog的一个开源版本；是Google开源的一个容器编排引擎，支持自动化部署、大规模可伸缩、应用容器化管理。"></a>k8s是基于容器技术的分布式架构领先方案。它是google严格保密十几年的秘密武器Brog的一个开源版本；是Google开源的一个容器编排引擎，支持自动化部署、大规模可伸缩、应用容器化管理。</h4><h2 id="K8S用来做什么？"><a href="#K8S用来做什么？" class="headerlink" title="K8S用来做什么？"></a>K8S用来做什么？</h2><p>说白了就是管理docker容器的，通过yaml文件生成容器 不需要手动去构建，可以生成多个容器，在一个容器挂掉的情况下，自动生成新的容器，配合jenkin做一个持续集成（CI），管理容器 jenkins相关内容：<a href="https://app.yinxiang.com/shard/s62/nl/21162980/087b3b40-4235-40ed-8005-f66a24bb06b1" target="_blank" rel="noopener">Jenkins+Gitlab+docker部署全流程 基于Centos7</a><br>流程如下：<br><img src="http://freeyjay.gitee.io/image_bed/pic/flowChart.jpg" alt=""></p>
<h4 id="一、K8S的搭建"><a href="#一、K8S的搭建" class="headerlink" title="一、K8S的搭建"></a>一、K8S的搭建</h4><ul>
<li><strong>可以参考以下文章</strong>：<a href="https://blog.csdn.net/qq_25147521/article/details/105129037" target="_blank" rel="noopener">kubeadm部署最新版k8s集群v1.18.0</a></li>
<li><strong>如果要搭建集群的话一定要记下来生成的token，后面node节点加入master要用到,用法如下图，在node节点的机器上输入红线所指的命令</strong></li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20200420165521105.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjQ1NDA2NA==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p>
<ul>
<li><p><strong>如果token和sha256没有记住可以通过如下命令来查看，或者参考这篇文章：</strong><a href="https://www.cnblogs.com/xiao987334176/p/11903665.html" target="_blank" rel="noopener">忘记K8S生成token的解决方案</a></p>
</li>
<li><p><code>kubeadm token list</code><br><img src="https://img-blog.csdnimg.cn/20200420165614680.png" alt="在这里插入图片描述"></p>
</li>
<li><p>也可以通过如下命令来生成一个永久的token ： <code>kubeadm token create --ttl 0</code></p>
</li>
<li><p>光有token还是不够的还需要借助一个sha256，通过如下命令来查看sha 256：</p>
<figure class="highlight gradle"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">openssl x509 -pubkey -in <span class="regexp">/etc/</span>kubernetes<span class="regexp">/pki/</span>ca.crt | openssl rsa -pubin -outform der <span class="number">2</span>&gt;<span class="regexp">/dev/</span><span class="keyword">null</span> | openssl dgst -sha256 -hex | sed <span class="string">'s/^.* //'</span></span><br></pre></td></tr></table></figure>

</li>
</ul>
<p><strong>- 如果是公网会有网络的坑，参考如下文章：<a href="https://www.cnblogs.com/life-of-coding/p/11879067.html" target="_blank" rel="noopener">阿里云搭建K8S初始化的坑</a></strong><br>    - 记好之后如上面面第一张图所示  </p>
<ul>
<li><strong>TIPS:一定要注意看上面文章的网络部分，网络配置不好后面的步骤就很难执行了，算是有一点小坑</strong><h4 id="二、K8S的YAML文件编写（重点-有坑）"><a href="#二、K8S的YAML文件编写（重点-有坑）" class="headerlink" title="二、K8S的YAML文件编写（重点 有坑）"></a>二、K8S的YAML文件编写（重点 有坑）</h4><img src="https://img-blog.csdnimg.cn/20200420165634233.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjQ1NDA2NA==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></li>
<li><strong>上图横线下面的apiVersion要注意 ，在kubernetes1.9版本中，引入apps/v1，deployment等资源从extensions/v1beta1, apps/v1beta1 和 apps/v1beta2迁入apps/v1，原来的v1beta1等被废弃 ，参考链接</strong>：<a href="https://blog.csdn.net/qq_29860591/article/details/103776478" target="_blank" rel="noopener">no matches for kind in version “extensions/v1beta1解决</a></li>
<li><strong>coreDns也有坑：</strong><a href="https://www.cnblogs.com/lvcisco/p/11339391.html" target="_blank" rel="noopener">点击查看解决方案</a></li>
<li><strong>K8S可视化Dashboard安装教程：</strong><a href="https://blog.csdn.net/zz_aiytag/article/details/103874977?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-15&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-15" target="_blank" rel="noopener">点击查看教程</a></li>
<li><strong>解决可视化界面搭建好后的匿名登陆问题：</strong><code>kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous</code> <a href="https://blog.csdn.net/jholy/article/details/85125997" target="_blank" rel="noopener">点击查看参考文章</a><h3 id="三、-网络踩坑！！"><a href="#三、-网络踩坑！！" class="headerlink" title="三、 网络踩坑！！"></a>三、 网络踩坑！！</h3></li>
</ul>
<p><strong>1、修改hosts配置域名解析</strong><br><img src="https://imgconvert.csdnimg.cn/aHR0cDovL2ZyZWV5amF5LmdpdGVlLmlvL2ltYWdlX2JlZC9waWMvNC5wbmc?x-oss-process=image/format,png" alt=""></p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/hosts</span><br><span class="line"></span><br><span class="line">修改完etc之后单独重启命令</span><br><span class="line">/etc/init.d<span class="built_in">/network </span>restart</span><br></pre></td></tr></table></figure>
<p><strong>2、修改 /etc/resolv.conf文件</strong><br><img src="https://img-blog.csdnimg.cn/20200424091903204.png" alt="在这里插入图片描述"></p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"> vi /etc/resolv.conf</span><br><span class="line"> </span><br><span class="line">删除这一行  options timeout:2 attempts:3 rotate single-request-reopen</span><br><span class="line"></span><br><span class="line"> 修改完之后重启网络命令</span><br><span class="line"><span class="built_in"> service network </span>restart</span><br><span class="line"> 为了防止重启不生效可以在网卡配置文件里配置如下参数</span><br><span class="line"> </span><br><span class="line"> vim /etc/sysconfig/network-scripts/ifcfg-eth0</span><br><span class="line"></span><br><span class="line"> <span class="attribute">PEERDNS</span>=<span class="literal">no</span></span><br></pre></td></tr></table></figure>
<p><strong>3、如果项目里配置了一个域名如：tsx-server，但是Dns并不能解析这个域名，因为并不是公网域名，可以通过再部署文件的yaml文件中添加 hostAliases解决（也就是配置pod里的hosts）</strong><br><img src="http://freeyjay.gitee.io/image_bed/pic/pod-HOSTS.jpg" alt="hostAliases"><br><strong>ENV的方式解决失败。。</strong><br><img src="http://freeyjay.gitee.io/image_bed/pic/pod-env.jpg" alt="env的方式"></p>
<hr>
<h4 id="四、jenkins的脚本"><a href="#四、jenkins的脚本" class="headerlink" title="四、jenkins的脚本"></a>四、jenkins的脚本</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="meta">#!/bin/sh</span></span><br><span class="line"><span class="comment"># 你的jar包名字</span></span><br><span class="line">jarName=spring-boot-demo-0.0.1-snapshot.jar</span><br><span class="line">jarFolder=ph</span><br><span class="line"><span class="comment"># 对应上图k8s的app name</span></span><br><span class="line">projectName=maven-deployment</span><br><span class="line"><span class="comment">#jenkins的工作空间</span></span><br><span class="line">docker_path=<span class="variable">$&#123;WORKSPACE&#125;</span></span><br><span class="line"></span><br><span class="line">cp <span class="variable">$&#123;WORKSPACE&#125;</span>/target/<span class="variable">$&#123;jarName&#125;</span> <span class="variable">$&#123;docker_path&#125;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"工作空间 <span class="variable">$&#123;WORKSPACE&#125;</span>/target/<span class="variable">$&#123;jarName&#125;</span> "</span></span><br><span class="line"><span class="comment">#执行脚本</span></span><br><span class="line">sh /root/docker_dir/deploy_docker.sh <span class="variable">$&#123;projectName&#125;</span> <span class="variable">$&#123;docker_path&#125;</span> <span class="variable">$&#123;jarName&#125;</span></span><br></pre></td></tr></table></figure>
<ul>
<li><p><strong>这一步脚本构建镜像，和删除老的镜像，一定要注意脚本的编写，不要出现名字写错。。防止运行不了</strong></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!bin/sh</span></span><br><span class="line"><span class="comment"># maven01 $workspace $jarname</span></span><br><span class="line"><span class="comment"># $&#123;projectName&#125; $&#123;docker_path&#125; $&#123;jarName&#125;</span></span><br><span class="line"><span class="built_in">set</span> -e</span><br><span class="line">projectName=<span class="variable">$1</span></span><br><span class="line"></span><br><span class="line">docker_path=<span class="variable">$2</span></span><br><span class="line"></span><br><span class="line">appName=<span class="variable">$3</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#user_name=</span></span><br><span class="line"><span class="comment">#password=</span></span><br><span class="line">tag=$(date +%s)</span><br><span class="line"></span><br><span class="line">sever_path=192.168.209.4:5000</span><br><span class="line"></span><br><span class="line">target_image=<span class="variable">$&#123;projectName&#125;</span>:<span class="variable">$&#123;tag&#125;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#$&#123;BUILD_NUMBER&#125;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"镜像名 <span class="variable">$&#123;target_image&#125;</span>"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$&#123;docker_path&#125;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"路径为：<span class="variable">$&#123;docker_path&#125;</span>"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"<span class="variable">$&#123;appName&#125;</span>"</span></span><br><span class="line">docker build --build-arg app=<span class="variable">$&#123;appName&#125;</span> -t <span class="variable">$&#123;target_image&#125;</span> .</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> <span class="string">"构建成功：<span class="variable">$&#123;target_image&#125;</span> <span class="variable">$&#123;sever_path&#125;</span>/<span class="variable">$&#123;projectName&#125;</span>"</span></span><br><span class="line">docker tag <span class="variable">$&#123;target_image&#125;</span> <span class="variable">$&#123;sever_path&#125;</span>/<span class="variable">$&#123;projectName&#125;</span></span><br><span class="line"></span><br><span class="line"> <span class="built_in">echo</span>  <span class="string">"推送是 docker push <span class="variable">$&#123;server_path&#125;</span>/<span class="variable">$&#123;projectName&#125;</span>:latest"</span></span><br><span class="line"></span><br><span class="line">docker push <span class="variable">$&#123;sever_path&#125;</span>/<span class="variable">$&#123;projectName&#125;</span>:latest</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">docker rmi -f $(docker images -q --filter reference=<span class="variable">$&#123;projectName&#125;</span>)</span><br></pre></td></tr></table></figure>
</li>
<li><p>执行编写好的kube.yaml，由k8s执行部署，下面的脚本需要设置jenkins服务器到k8s-master服务器的免密登陆</p>
</li>
<li><p><strong>生成sshKey的命令</strong><br><code>cd ~/.ssh</code><br><code>ssh-keygen -t rsa -C xxx@txxx.cn</code></p>
</li>
<li><p><strong>把生成的sshkey拷贝到master节点，这步做完就可以实现master节点的免密登陆</strong><br><code>ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.209.4</code></p>
</li>
</ul>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">set</span> -e</span><br><span class="line"></span><br><span class="line">echo <span class="variable">$&#123;WORKSPACE&#125;</span></span><br><span class="line"><span class="comment"># 把kube.yaml移动到宿主机的root目录下</span></span><br><span class="line">scp <span class="variable">$&#123;WORKSPACE&#125;</span>/<span class="regexp">*.yaml</span> <span class="number">192.168.209.3</span>:/root/</span><br><span class="line"><span class="comment"># 执行脚本</span></span><br><span class="line">ssh <span class="number">192.168.209.3</span> <span class="string">'/usr/bin/kubectl apply -f /root/kube.yaml'</span></span><br><span class="line">ssh <span class="number">192.168.209.3</span> <span class="string">'/usr/bin/kubectl get svc|grep maven'</span></span><br></pre></td></tr></table></figure>


<h4 id="K8S一些基础命令"><a href="#K8S一些基础命令" class="headerlink" title="K8S一些基础命令"></a>K8S一些基础命令</h4><ul>
<li><p>查看pod运行在什么节点上：</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl  <span class="builtin-name">get</span> pods  -o wide</span><br></pre></td></tr></table></figure></li>
<li><p>查看全部pod所在的节点：</p>
<figure class="highlight applescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="keyword">get</span> pods -o wide <span class="comment">--all-namespaces</span></span><br></pre></td></tr></table></figure></li>
<li><p>根据podName查找：</p>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="built_in">get</span> <span class="keyword">po</span> --<span class="keyword">all</span>-namespaces | <span class="keyword">grep</span> maven</span><br></pre></td></tr></table></figure></li>
<li><p>查看日志：</p>
<figure class="highlight ebnf"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">kubectl logs -f podName</span></span><br></pre></td></tr></table></figure></li>
<li><p>查看某个命名空间下的pod锁在节点：</p>
<figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="built_in">get</span> pods -n kube-<span class="keyword">system</span> -o wide</span><br></pre></td></tr></table></figure></li>
<li><p>查看有问题的pod详情：</p>
<figure class="highlight maxima"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="built_in">describe</span> pods podName  -n kube-<span class="built_in">system</span></span><br></pre></td></tr></table></figure></li>
<li><p>查看具体的某一个命名空间下的详情和端口：</p>
<figure class="highlight armasm"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="symbol">kubectl</span> <span class="meta">get</span> pods,<span class="keyword">svc </span>-n kubernetes-dashboard -o wide</span><br></pre></td></tr></table></figure></li>
<li><p>删除指定的pod：</p>
<figure class="highlight gauss"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="keyword">delete</span> pod podName -n kube-<span class="keyword">system</span></span><br></pre></td></tr></table></figure></li>
<li><p>查看具体的pod 500行日志：</p>
<figure class="highlight delphi"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl logs -f  --tail <span class="number">500</span>   etcd-izuf64dhkm7uc5t46cuojkz  -n kube-system` （-n  是指<span class="keyword">name</span> space，如果不加这个默认在<span class="keyword">default</span>下面寻找）</span><br></pre></td></tr></table></figure></li>
<li><p>查看某个命名空间下pod运行节点命令</p>
<figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="built_in">get</span> pods -o wide -n kube-<span class="keyword">system</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>删除某个用yaml启动的pod</p>
<figure class="highlight actionscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">kubectl <span class="keyword">delete</span> -f centos_deployment.yaml</span><br></pre></td></tr></table></figure></li>
<li><p>用yaml启动pod </p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">kubectl</span> <span class="selector-tag">create</span> <span class="selector-tag">-f</span> <span class="selector-tag">centos_deployment</span><span class="selector-class">.yaml</span></span><br></pre></td></tr></table></figure>
</li>
</ul>

    </section>
    <section class="extra">
      
        <section class="donate">
  <div class="qrcode">
    <img src="">
  </div>
  <div class="icon">
    <a href="javascript:;" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
      
      
      
<nav class="nav">
  
    <a href="/blog/2020/04/30/RabbitMQ%E6%B6%88%E6%81%AF%E4%B8%AD%E9%97%B4%E4%BB%B6/"><i class="iconfont iconleft"></i>RabbitMQ消息中间件</a>
  
  
</nav>

    </section>
    
  </section>
</article>
  </div>
</main>
  <footer class="footer">
  <div class="footer-social">
    
    
    
    
    
    <a href="tencent://message/?Menu=yes&uin=1095159827 " target="_blank" onMouseOver="this.style.color= '#12B7F5'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconQQ "></i>
    </a>
    
    
    
    
    
    <a href="javascript:; " target="_blank" onMouseOver="this.style.color= '#09BB07'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconwechat-fill "></i>
    </a>
    
    
    
    
    
    <a href="https://www.instagram.com/yuangege233/ " target="_blank" onMouseOver="this.style.color= '#DA2E76'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconinstagram "></i>
    </a>
    
    
    
    
    
    <a href="https://github.com/yuanyonglin " target="_blank" onMouseOver="this.style.color= '#24292E'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  icongithub-fill "></i>
    </a>
    
    
    
    
    
    <a href="mailto:yuanyonglin1995@gmail.com " target="_blank" onMouseOver="this.style.color='#FFBE5B'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconmail"></i>
    </a>
    
  </div>
  <div class="footer-copyright"><p>Copyright© 2019-2019 | <a target="_blank" href="https://gitee.com/FreeYJay">yuanyl</a> .AllRightsReserved</p></div>
</footer>
    <div class="fab fab-plus">
    <i class="iconfont iconplus"></i>
  </div>
  <div class="fab fab-up">
    <i class="iconfont iconcaret-up"></i>
  </div>
  <div class="fab fab-menu">
    <i class="iconfont iconmenu"></i>
  </div>
</body>


<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>






<script src="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.js"></script>








<script src="/blog/js/script.js"></script>



</html>